<?php
/**
 * @file bg-cc.php	Fixed!
 * @version 0.1
 * @desc 删除订单
 * 
 */

$action = $_POST['action'];
$user_id = $_POST['user_id'];
$kid = $_POST['kid'];

$msg = 0;
/**
 * 1. 流水操作成功
 * 
 * 444. 数据库连接失败
 * 
 * 410. action为空 或者 错误
 * 411. 用户为空
 * 412. 操作数kid为空
 * 
 */
if ($action == 'delKb'){
	if (empty($user_id))
		$msg = 411;
	elseif (empty($kid))
		$msg = 412;
	else {
		//登录验证
		require_once 'setting.php';
		if (validaStatus4AJAX() == 1){
			$msg = 403;
		}else {
			$sql = "CALL ".DB_NAME_KBAO.".sp_trustCancel_t({$kid})";
			Appleseed::executeSQL($sql);
			$msg=1;
		}
	}
}else 
	$msg = 440;
echo json_encode($msg);

?>